<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>background</title>
    <style>
        body{
            background:yellow;
        }
        .c1{
            height:90px;
            background:rgba(255,0,0, .3);
            /* background: hsla(hue, saturation, lightness, alpha); */
            /* background:url(./test.png); */
        }
        .c2{
            height:90px;

            /* 下面这个渐变色是老式写法, from left */
            /* background: -webkit-linear-gradient(left, red, green); */


            /* background: linear-gradient(to right, red, green); */


            /* 渐变色的角度是指从左上角到右下角的角度变化,颜色后面的百分比是指颜色出现的位置 */
            /* background: linear-gradient(180deg, red, green); */
            /* background: linear-gradient(135deg, red 0, green 10%, yellow 50%, blue 100%); */
            background: linear-gradient(135deg, transparent 0, transparent 49.5%, green 49.5%, green 50.5%, transparent 50.5%, transparent 100%),
                linear-gradient(45deg, transparent 0, transparent 49.5%, red 49.5%, red 50.5%, transparent 50.5%, transparent 100%);
           
            /* 设置背景图大小,当size小于 */
            /* background-size: 30px 30px; */
        }
    </style>
</head>
<body>
    <div class="c1">

    </div>
    <div class="c2">

    </div>
</body>
</html>